<div class="box round first">
<?php 	if (isset($_GET['id_journal'])):?>
<?php 	$id_journal = $_GET['id_journal']?>
<?php 	$journal = $this->getJournal ($id_journal)?>
<?php 	if (isset($journal['id_journal'])):?>
<?php 	$pagers = $this->getAllPagerOfJournal ($id_journal);?>
	<h2><?php echo $journal['name'];?>
	</h2>
	<div class="block">
		<!-- paragraphs -->
		<p class="start"><img class="right" alt="Ginger" src="<?php echo $journal['subject']?>"><?php echo $journal['subject']?></p>
		<p class="start"><?php echo $journal['contact']?></p>
		<p class="start"><?php echo $journal['description']?></p>
		<!-- end paragraphs -->                    
	</div>
</div>
<a class="btn btn-blue" href="<?php echo Epic::getUrl('admin/journal/addPager',array('id_journal'=>$journal['id_journal']));?>">Add pager</a>
<div class="box round first grid">
<h2>List pagers</h2>
<div class="block">
<table class="data display datatable" id="example">
	<thead>
		<tr>
		<th>ID</th>
		<th>Name</th>
		<th>Volume - Isue</th>
		<th>Pagers</th>
		<th>Tool</th>
		</tr>
	</thead>
		<tbody>
		<?php if ($pagers !=null):?>
		<?php foreach ($pagers as $pager):?>
			<tr class="odd gradeX">
				<td><?php echo $pager['id_pager']?></td>
				<td><?php echo $pager['name']?></td>
				<td><?php echo "Volume ".$pager['volume']."- Issue ".$pager['issue']?></td>
				<td><?php echo $pager['page_start']."-".$pager['page_end']?></td>
				<td>
					<a class="btn-mini btn-black btn-view" href="<?php echo Epic::getUrl('admin/journal/viewPager',array('id_journal'=>$journal['id_journal']))?>"><span></span>View</a>
					<a class="btn-mini btn-black btn-edit" href="<?php echo Epic::getUrl('admin/journal/addPager',array('id_journal'=>$journal['id_journal'],'id_pager'=>$pager['id_pager']))?>"><span></span>Edit</a>
				</td>
			</tr>
		<?php endforeach;?>
		<?php endif;?>
		</tbody>
	</table>
	</div>

<?php else:?>
	<span style="color: blue;">Journal does not exist</span>
<?php endif;?>
<?php else:?>
	<span style="color: blue;">Journal does not exist</span>
<?php endif;?>
</div>